Last updated: 2024-01-17
Checks: 7 0
Knit directory: UPF1-FMR1/
This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20230923) was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 961f504. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish or
wflow_git_commit). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rproj.user/
Ignored: analysis/Exploratory-DEG.nb.html
Ignored: analysis/Quality-control.nb.html
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/DEG-analysis.Rmd) and HTML
(docs/DEG-analysis.html) files. If you’ve configured a
remote Git repository (see ?wflow_git_remote), click on the
hyperlinks in the table below to view the files as they were in that
past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| html | 144afef | urwahnawaz | 2024-01-17 | Build site. |
| Rmd | 068b751 | urwahnawaz | 2024-01-17 | wflow_git_commit("./*") |
| html | facdd9d | urwahnawaz | 2024-01-17 | Build site. |
| html | 6cb16fa | urwahnawaz | 2024-01-17 | Build site. |
| Rmd | e0ee067 | urwahnawaz | 2024-01-17 | wflow_publish("analysis/DEG-analysis.Rmd") |
| html | 2b5790f | urwahnawaz | 2024-01-12 | Build site. |
| Rmd | bd34cfd | urwahnawaz | 2024-01-12 | wflow_publish("analysis/DEG-analysis.Rmd") |
source(here::here("code/libraries.R"))
library(stargazer)
library(ggfortify)
library(glue)
library(cowplot)
library(broom)
library(glmpca)
library(naniar)
library(gridExtra)
library(EnsDb.Hsapiens.v86)
library(ggrepel)
library(org.Hs.eg.db)
library(msigdbr)
library(fgsea)
goSummaries <- url("https://uofabioinformaticshub.github.io/summaries2GO/data/goSummaries.RDS") %>%
readRDS() %>%
mutate(ontology = as.character(ontology))
getGeneLists <- function(pwf, goterms, genome, ids){
gene2cat <- getgo(rownames(pwf), genome, ids)
cat2gene <- split(rep(names(gene2cat), sapply(gene2cat, length)),
unlist(gene2cat, use.names = FALSE))
out <- list()
for(term in goterms){
tmp <- pwf[cat2gene[[term]],]
tmp <- rownames(tmp[tmp$DEgenes > 0, ])
out[[term]] <- tmp
}
out
}
txdf = transcripts(EnsDb.Hsapiens.v86, return.type="DataFrame")
tx2gene = as.data.frame(txdf[,c("tx_id","gene_id", "tx_biotype")])
ah <- AnnotationHub() %>%
subset(species == "Homo sapiens") %>%
subset(rdataclass == "EnsDb") %>%
subset(genome == "GRCh38")
ensDb <- ah[["AH109606"]]
grTrans <- transcripts(ensDb)
trLengths <- exonsBy(ensDb, "tx") %>%
width() %>%
vapply(sum, integer(1))
mcols(grTrans)$length <- trLengths[names(grTrans)]
genesGR = genes(ensDb)
transGR = transcripts(ensDb)
mcols(transGR) = mcols(transGR) %>%
cbind(
transcriptLengths(ensDb)[rownames(.), c("nexon", "tx_len")]
)
id2Name <- structure(
genesGR$gene_name,
names = genesGR$gene_id
) %>%
.[!duplicated(names(.))]
salmon.files = ("/home/neuro/Documents/NMD_analysis/Analysis/Results/UPF1-FMR1/Salmon")
salmon = list.files(salmon.files, pattern = "transcripts$", full.names = TRUE)
all_files = file.path(salmon, "quant.sf")
sample_names = gsub("/home/neuro/Documents/NMD_analysis/Analysis/Results/UPF1-FMR1/Salmon/", "", salmon)
sample_names = gsub(".gz_transcripts", "", sample_names)
sample_names = gsub("\\_.*", "", sample_names)
names(all_files) <- sample_names
md = read.csv(here::here("data/Sample_info.csv"), header= TRUE) %>%
#mutate(files = file.path(salmon, "quant.sf")) %>%
dplyr::rename("names" = "GeneWiz.ID",
"Group" = "Sample.type") %>%
mutate(Group = ifelse(Group == "MC" | Group == "FC", "Control", Group)) %>%
dplyr::select(names,everything()) %>%
mutate(names = gsub("\\_.*", "", names) )
md = md[order(match(md$names, sample_names)),]
md %<>%
rownames_to_column("random") %>%
# column_to_rownames("names") %>%
dplyr::select(-random) %>%
mutate(files = all_files)
md %<>% dplyr::filter(Group != "FMR1") %>%
dplyr::filter(names != "23-LDJ6767") %>%
dplyr::filter(names != "202")
all_files = all_files[names(all_files) %in% md$names]
txi_genes = tximport(all_files, type="salmon", txOut=FALSE,
countsFromAbundance="scaledTPM", tx2gene = tx2gene, ignoreTxVersion = TRUE, ignoreAfterBar = TRUE)
keep.genes = (rowSums(txi_genes$abundance >= 1 ) >= 3)
txi_genes_filtered = txi_genes$counts[keep.genes,]
y <- DGEList(txi_genes_filtered)
design <- model.matrix(~Batch +Group + Sex, data = md) %>%
set_colnames(gsub(pattern = "Group", replacement ="", x = colnames(.)))
y <- calcNormFactors(y)
v <- voom(y, design)
fit = lmFit(v, design) %>%
eBayes()
summary(decideTests(fit, lfc =0))
(Intercept) Batch FRAX UPF1 SexM
Down 398 439 533 233 11
NotSig 2189 12093 11814 12551 13189
Up 10627 682 867 430 14
upf1_results_lfc = topTable(fit,coef = "UPF1", number = Inf) %>%
mutate(res = ifelse(logFC > 0& adj.P.Val < 0.05, "Upregulated",
ifelse(logFC < 0 & adj.P.Val < 0.05, "Downregulated", "NotSig"))) %>%
rownames_to_column("ensembl_gene_id") %>%
mutate(SYMBOL = mapIds(org.Hs.eg.db, keys=ensembl_gene_id, column="SYMBOL",keytype="ENSEMBL", multiVals="first")) %>%
mutate(res = ifelse(logFC > 0 & adj.P.Val < 0.05, "Upregulated",
ifelse(logFC < 0 & adj.P.Val < 0.05, "Downregulated", "NotSig")))
DEColours <- c("Downregulated" = "#2e294e","Upregulated" = "#720026", "NotSig" = "#E5E5E5")
volc_upf1 = upf1_results_lfc %>%
ggplot(aes(y = -log10(adj.P.Val),
x = logFC ,
colour = res,
size =-log10(adj.P.Val),
label= SYMBOL)) +
geom_point(alpha = 0.8) +
# geom_text(aes(label=ifelse(SYMBOL== "Upf1",as.character(SYMBOL),''))) +
# geom_text(aes(label= SYMBOL), subset = SYMBOL == "Upf1") +
scale_colour_manual(values = DEColours) + theme_classic() +
theme(axis.title.y = element_text(size = 12)) +
geom_hline(yintercept = -log10(0.05), color = "grey60", size = 0.5, lty = "dashed") +
labs(x = "log2 Fold Change", y = "-log10 adj p-value") +
geom_vline(xintercept = 0, size = 0.5, lty = "dashed", color = "grey60") +
xlim(-8.5, 8.5) + ylim(0, 7.5)
# volc = volc_upf1+ geom_text_repel(data=subset(upf1_results_lfc , SYMBOL %in% c("UPF1", "UPF2", "UPF3B",
# "SMG5", "SMG6",
# "UPF3A", "ATF4",
# "GADD5G")),
# aes(label=SYMBOL), position=position_dodge(width = 0.9),
# vjust=-0.40, color = "black", box.padding = 0.5, fill = "white") + ggtitle("DEGs in UPF1 relative to controls using limma/voom")
#
#
# volc
my_gg = volc_upf1 + geom_point_interactive(aes(tooltip =SYMBOL, data_id = SYMBOL),
size = 1, hover_nearest = TRUE)
girafe(ggobj = my_gg)
Volcano plot showing distribution of differentially expressed genes using the limma/voom pipeline
upf1_results_lfc %>%
dplyr::filter(adj.P.Val < 0.05) %>%
dplyr::select(SYMBOL,ensembl_gene_id, logFC, adj.P.Val) %>%
dplyr::arrange(adj.P.Val) %>%
DT::datatable(caption="DEGS in UPF1 relative to controls using limma/voom pipeline")
frax_results_lfc = topTable(fit,coef = "FRAX", number = Inf) %>%
mutate(res = ifelse(logFC > 0 & adj.P.Val < 0.05, "Upregulated",
ifelse(logFC < 0 & adj.P.Val < 0.05, "Downregulated", "NotSig"))) %>%
rownames_to_column("ensembl_gene_id") %>%
mutate(SYMBOL = mapIds(org.Hs.eg.db, keys=ensembl_gene_id, column="SYMBOL",keytype="ENSEMBL", multiVals="first")) %>%
mutate(res = ifelse(logFC > 0 & adj.P.Val < 0.05, "Upregulated",
ifelse(logFC < 0 & adj.P.Val < 0.05, "Downregulated", "NotSig")))
DEColours <- c("Downregulated" = "#2e294e","Upregulated" = "#720026", "NotSig" = "#E5E5E5")
volc_frax = frax_results_lfc %>%
ggplot(aes(y = -log10(adj.P.Val),
x = logFC ,
colour = res,
size =-log10(adj.P.Val),
label= SYMBOL)) +
geom_point(alpha = 0.8) +
# geom_text(aes(label=ifelse(SYMBOL== "Upf1",as.character(SYMBOL),''))) +
# geom_text(aes(label= SYMBOL), subset = SYMBOL == "Upf1") +
scale_colour_manual(values = DEColours) + theme_classic() +
theme(axis.title.y = element_text(size = 12)) +
geom_hline(yintercept = -log10(0.05), color = "grey60", size = 0.5, lty = "dashed") +
labs(x = "log2 Fold Change", y = "-log10 adj p-value") +
geom_vline(xintercept = 0, size = 0.5, lty = "dashed", color = "grey60") +
xlim(-8.5, 8.5) + ylim(0, 7.5)
# volc = volc + geom_text_repel(data=subset(upf1_results_lfc , SYMBOL %in% c("UPF1", "UPF2", "UPF3B",
# "SMG5", "SMG6",
# "UPF3A", "ATF4",
# "GADD5G", "FMR1")),
# aes(label=SYMBOL), position=position_dodge(width = 0.9),
# vjust=-0.40, color = "black", box.padding = 0.5, fill = "white") + ggtitle("DEGs in FRAX relative to controls using limma/voom pipeline")
my_gg = volc_frax + geom_point_interactive(aes(tooltip =SYMBOL, data_id = SYMBOL),
size = 1, hover_nearest = TRUE)
girafe(ggobj = my_gg)
library(VennDiagram)
x= list("UPF1 DEGs" = upf1_results_lfc$ensembl_gene_id[upf1_results_lfc$adj.P.Val < 0.05],
"FRAX DEGs" = frax_results_lfc$ensembl_gene_id[frax_results_lfc$adj.P.Val < 0.05])
ggvenn(x)

| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
overlaps = calculate.overlap(x)
upf1_only = overlaps$a1[!overlaps$a1 %in% overlaps$a3]
fmr1_only = overlaps$a2[!overlaps$a2 %in% overlaps$a3]
upf1_results_lfc %>%
dplyr::filter(adj.P.Val < 0.05) %>%
dplyr::select(SYMBOL,ensembl_gene_id, logFC, adj.P.Val) %>%
inner_join(frax_results_lfc %>%
dplyr::filter(adj.P.Val < 0.05) %>%
dplyr::select(ensembl_gene_id, FRAX.logFC=logFC,
FRAX.padj =adj.P.Val), by = "ensembl_gene_id") %>%
ggscatter(., x="logFC", y = "FRAX.logFC", cor.coef = TRUE, add = "reg.line",
size=5, alpha =0.6,
conf.int = TRUE, add.params = list(color = "#EF3829",
fill = "lightgray")) +
theme_bw() + ylab("FRAX (log2FoldChange)") + xlab("UPF1 (log2FoldChange)") +
geom_hline(yintercept = 0, size = 0.5,lty = "dashed", color = "grey60") +
geom_vline(xintercept = 0, size = 0.5, lty = "dashed", color = "grey60") + ggtitle("Direction of expression of the 222 overlapping genes")
Overlap of significant genes from FRAX and UPF1
| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
genes = as.integer(upf1_results_lfc$ensembl_gene_id %in% overlaps$a3)
not_na = !is.na(genes)
names(genes) = upf1_results_lfc$ensembl_gene_id
genes = genes[not_na]
pwf=nullp(genes,plot.fit = FALSE, 'hg19','ensGene')
Go.wall=goseq(pwf, 'hg19','ensGene', use_genes_without_cat = TRUE)
goterms <- Go.wall$category
goList <- getGeneLists(pwf, goterms, 'hg19','ensGene')
Go.wall$EnsemblID <- sapply(Go.wall$category, function(x) goList[[x]])
Go.wall$EnsemblID <- vapply(Go.wall$EnsemblID, paste, collapse = ", ", character(1L))
goRes = Go.wall %>%
dplyr::select(-under_represented_pvalue) %>%
dplyr::filter(numDEInCat > 0) %>%
dplyr::rename(id = category) %>%
left_join(goSummaries)
nGenes <- c(BG = sum(genes == 0), DE = sum(genes))
goFinal <- goRes %>%
dplyr::filter(numDEInCat > 2) %>%
dplyr::filter(shortest_path > 3) %>%
arrange(desc(shortest_path), EnsemblID) %>%
distinct(EnsemblID, .keep_all = TRUE) %>%
arrange(over_represented_pvalue) %>%
mutate(Expected = round(nGenes[["DE"]] * numInCat / nGenes[["BG"]], 0)) %>%
mutate(adjP = p.adjust(over_represented_pvalue, "bonferroni"),
FDR = p.adjust(over_represented_pvalue, "fdr"),
Sig_adjP = adjP < 0.05, Sig_FDR = FDR < 0.05) %>%
dplyr::filter(Sig_adjP, numDEInCat > Expected) %>%
dplyr::select(term, everything())
goFinal %>%
DT::datatable(caption="222 overlapping genes")
upf1_results_lfc %>%
dplyr::filter(ensembl_gene_id %in% upf1_only) %>%
dplyr::select(SYMBOL,ensembl_gene_id, logFC, adj.P.Val) %>%
inner_join(frax_results_lfc %>%
dplyr::select(ensembl_gene_id, FRAX.logFC=logFC,
FRAX.padj =adj.P.Val), by = "ensembl_gene_id") %>%
ggscatter(., x="logFC", y = "FRAX.logFC", cor.coef = TRUE, add = "reg.line",
size=5, alpha =0.6,
conf.int = TRUE, add.params = list(color = "#EF3829",
fill = "lightgray")) +
theme_bw() + ylab("FRAX (log2FoldChange)") + xlab("UPF1 (log2FoldChange)") +
geom_hline(yintercept = 0, size = 0.5,lty = "dashed", color = "grey60") +
geom_vline(xintercept = 0, size = 0.5, lty = "dashed", color = "grey60") + ggtitle("Direction of expression of the 441 UPF1 specific genes")

| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
genes = as.integer(upf1_results_lfc$ensembl_gene_id %in% upf1_only)
not_na = !is.na(genes)
names(genes) = upf1_results_lfc$ensembl_gene_id
genes = genes[not_na]
pwf=nullp(genes,plot.fit = FALSE, 'hg19','ensGene')
Go.wall=goseq(pwf, 'hg19','ensGene', use_genes_without_cat = TRUE)
goterms <- Go.wall$category
goList <- getGeneLists(pwf, goterms, 'hg19','ensGene')
Go.wall$EnsemblID <- sapply(Go.wall$category, function(x) goList[[x]])
Go.wall$EnsemblID <- vapply(Go.wall$EnsemblID, paste, collapse = ", ", character(1L))
goRes = Go.wall %>%
dplyr::select(-under_represented_pvalue) %>%
dplyr::filter(numDEInCat > 0) %>%
dplyr::rename(id = category) %>%
left_join(goSummaries)
nGenes <- c(BG = sum(genes == 0), DE = sum(genes))
goFinal <- goRes %>%
dplyr::filter(numDEInCat > 2) %>%
dplyr::filter(shortest_path > 4) %>%
arrange(desc(shortest_path), EnsemblID) %>%
distinct(EnsemblID, .keep_all = TRUE) %>%
arrange(over_represented_pvalue) %>%
mutate(Expected = round(nGenes[["DE"]] * numInCat / nGenes[["BG"]], 0)) %>%
mutate(adjP = p.adjust(over_represented_pvalue, "bonferroni"),
FDR = p.adjust(over_represented_pvalue, "fdr"),
Sig_adjP = adjP < 0.05, Sig_FDR = FDR < 0.05) %>%
dplyr::filter(Sig_adjP, numDEInCat > Expected) %>%
dplyr::select(term, everything())
goFinal %>%
DT::datatable(caption="UPF1 specific genes")
frax_results_lfc %>%
dplyr::filter(ensembl_gene_id %in% fmr1_only) %>%
dplyr::select(SYMBOL,ensembl_gene_id, FRAX.logFC=logFC,
FRAX.padj =adj.P.Val) %>%
inner_join(upf1_results_lfc %>%
dplyr::select(ensembl_gene_id, logFC,
adj.P.Val), by = "ensembl_gene_id") %>%
ggscatter(., x="logFC", y = "FRAX.logFC", cor.coef = TRUE, add = "reg.line",
size=5, alpha =0.6,
conf.int = TRUE, add.params = list(color = "#EF3829",
fill = "lightgray")) +
theme_bw() + ylab("FRAX (log2FoldChange)") + xlab("UPF1 (log2FoldChange)") +
geom_hline(yintercept = 0, size = 0.5,lty = "dashed", color = "grey60") +
geom_vline(xintercept = 0, size = 0.5, lty = "dashed", color = "grey60") + ggtitle("Direction of expression of the 1178 FRAX specific genes")

| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
Gene ontology
genes = as.integer(frax_results_lfc$ensembl_gene_id %in% fmr1_only)
not_na = !is.na(genes)
names(genes) = frax_results_lfc$ensembl_gene_id
genes = genes[not_na]
pwf=nullp(genes,plot.fit = FALSE, 'hg19','ensGene')
Go.wall=goseq(pwf, 'hg19','ensGene', use_genes_without_cat = TRUE)
goterms <- Go.wall$category
goList <- getGeneLists(pwf, goterms, 'hg19','ensGene')
Go.wall$EnsemblID <- sapply(Go.wall$category, function(x) goList[[x]])
Go.wall$EnsemblID <- vapply(Go.wall$EnsemblID, paste, collapse = ", ", character(1L))
goRes = Go.wall %>%
dplyr::select(-under_represented_pvalue) %>%
dplyr::filter(numDEInCat > 0) %>%
dplyr::rename(id = category) %>%
left_join(goSummaries)
nGenes <- c(BG = sum(genes == 0), DE = sum(genes))
goFinal <- goRes %>%
dplyr::filter(numDEInCat > 2) %>%
dplyr::filter(shortest_path > 4) %>%
arrange(desc(shortest_path), EnsemblID) %>%
distinct(EnsemblID, .keep_all = TRUE) %>%
arrange(over_represented_pvalue) %>%
mutate(Expected = round(nGenes[["DE"]] * numInCat / nGenes[["BG"]], 0)) %>%
mutate(adjP = p.adjust(over_represented_pvalue, "bonferroni"),
FDR = p.adjust(over_represented_pvalue, "fdr"),
Sig_adjP = adjP < 0.05, Sig_FDR = FDR < 0.05) %>%
dplyr::filter(Sig_adjP, numDEInCat > Expected) %>%
dplyr::select(term, everything())
goFinal %>%
DT::datatable(caption="FRAX specific genes")
dsbs = read_xlsx(here::here("data/lists/DSBs/FX_DSB_genes.xlsx"), skip = 1)
exp_cl = read_xlsx(here::here("data/lists/DSBs/msrd_results_LCL_Silent_Genes.xlsx"), sheet = 1)
dsbs_lcls = dsbs[!dsbs$ensembl_gene_id %in% exp_cl$ensembl_id,]
Jozef’s questions
Is there an overlap of genes with DSBs in FRAXA/FMR1 LCLs and the DEGs in FRAXA/FMR1 LCLs even if across 2x different studies? If not overlap based on p value, is there a trend for these DSB-associated genes to be downregulated? *Is there an overlap of genes with DSBs in FRAXA/FMR1 LCLs and DEGs in UPF3B patient LCLs, the reason being that UPF3B patients have no or very little FMRP left as Saba determined? Also, if no overlap strictly on p value, is there a trend of the DSB genes to be down-regulated in UPF3B LCLs?
The same as above, but comparing the DSB genes to UPF1 DEGs, etc.
From this study - using the FRAX DEGs and UPF1 DEGs
x= list("UPF1 DEGs" = upf1_results_lfc$ensembl_gene_id[upf1_results_lfc$adj.P.Val < 0.05],
"FRAX DEGs" = frax_results_lfc$ensembl_gene_id[frax_results_lfc$adj.P.Val < 0.05],
"Double stranded breaks" = dsbs$ensembl_gene_id)
ggvenn(x)

| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
frax_results_lfc %>%
dplyr::filter(adj.P.Val < 0.05) %>%
mutate(condition="FRAX") %>%
inner_join(dsbs, by = "ensembl_gene_id") %>%
rbind(upf1_results_lfc %>%
dplyr::filter(adj.P.Val < 0.05) %>%
mutate(condition="UPF1") %>%
inner_join(dsbs, by = "ensembl_gene_id")) %>%
ggplot(aes(x=condition, fill = res), color = "white") + geom_bar(stat = "count") +
theme_bw() + scale_fill_manual(values =c("Upregulated"= "#720026",
"Downregulated"= "#2e294e")) +
ggtitle("Number of DEGs with DSBs")
Genes with DSBs identified in significantly expressed DEGs
| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
library(ggstatsplot)
frax_results_lfc %>%
mutate(res = ifelse(logFC > 0, "Upregulated",
ifelse(logFC < 0, "Downregulated", "NotSig"))) %>%
mutate(condition="FRAX") %>%
inner_join(dsbs, by = "ensembl_gene_id") %>%
rbind(upf1_results_lfc %>%
mutate(res = ifelse(logFC > 0, "Upregulated",
ifelse(logFC < 0, "Downregulated", "NotSig"))) %>%
mutate(condition="UPF1") %>%
inner_join(dsbs, by = "ensembl_gene_id")) %>%
ggbarstats(
x = res,
y = condition,
xlab = "",
legend.title = "",
ggplot.component = list(ggplot2::scale_x_discrete(guide = ggplot2::guide_axis(n.dodge = 2))),
) + scale_fill_manual(values =c("Upregulated"= "#720026",
"Downregulated"= "#2e294e"))
Genes with DSBs identified in significantly expressed DEGs
| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
# ggplot(aes(x=condition, fill = res), color = "white") + geom_bar(stat = "count") +
#theme_bw() + scale_fill_manual(values =c("Upregulated"= "#720026",
# "Downregulated"= "#2e294e")) +
#ggtitle("Number of DEGs with DSBs")
library(GeneOverlap)
enrichment_gene_list_pvalue = list()
enrichment_gene_list_OR = list()
test.list = list()
test.list$BG = frax_results_lfc$ensembl_gene_id
test.list$frax_sig = frax_results_lfc$ensembl_gene_id[frax_results_lfc$adj.P.Val < 0.05]
test.list$frax_sig_up = frax_results_lfc$ensembl_gene_id[frax_results_lfc$adj.P.Val < 0.05 & frax_results_lfc$logFC > 0]
test.list$frax_sig_down = frax_results_lfc$ensembl_gene_id[frax_results_lfc$adj.P.Val < 0.05 & frax_results_lfc$logFC < 0]
test.list$upf1_sig = upf1_results_lfc$ensembl_gene_id[upf1_results_lfc$adj.P.Val < 0.05]
test.list$upf1_sig_up = upf1_results_lfc$ensembl_gene_id[upf1_results_lfc$adj.P.Val < 0.05 & upf1_results_lfc$logFC > 0]
test.list$upf1_sig_down = upf1_results_lfc$ensembl_gene_id[upf1_results_lfc$adj.P.Val < 0.05 & upf1_results_lfc$logFC < 0]
test.list$dsbs = dsbs$ensembl_gene_id
## Maybe an exact test with odds ratio
for (list in c("frax_sig","frax_sig_up","frax_sig_down","upf1_sig",
"upf1_sig_up", "upf1_sig_down")) {
go.obj <- newGeneOverlap(test.list[[list]],
test.list$dsbs,
genome.size=length(test.list$BG))
go.obj <- testGeneOverlap(go.obj)
enrichment_gene_list_pvalue[[paste0(list)]] = go.obj@pval
enrichment_gene_list_OR[[paste0(list)]] = go.obj@odds.ratio
}
enrichment_GL_pval = do.call(rbind, enrichment_gene_list_pvalue) %>% as.data.frame()
colnames(enrichment_GL_pval)[1] = c("pvalue")
enrichment_GL_pval$padj = p.adjust(enrichment_GL_pval$pvalue, method = "BH")
enrichment_GL_OR = do.call(rbind, enrichment_gene_list_OR) %>% as.data.frame()
colnames(enrichment_GL_OR)[1] = c("OR")
GL_enrichment = cbind(enrichment_GL_pval, enrichment_GL_OR)
GL_enrichment %>%
rownames_to_column("DEGs") %>%
ggplot(aes(x=OR, y = DEGs)) + geom_bar(stat = "identity", fill = "#edafb8") +
theme_bw() + geom_vline(xintercept = 1) +
theme(axis.text.x = element_text(size = 12, family = "serif", color = "black"),
axis.text.y = element_text(size = 12, family = "serif", color = "black"),
axis.title = element_text(size=12, family = "serif"),
legend.box.background = element_rect(color = "black"),
legend.text = element_text(family = "serif"),
legend.title = element_text( family = "serif"),
plot.title = element_text(family = "serif", size =20),
panel.grid.major.x = element_blank(),
panel.grid.major.y = element_line( size=.1 ),
legend.position = "top",
strip.text.y = element_text(
size = 10, face = "bold.italic", family = "serif"
),
strip.text.x = element_text(
size = 10, family = "serif"
)) + labs(x="Odds ratio") + ggtitle("Enrichment of DSBs in UPF1 or FRAX")

| Version | Author | Date |
|---|---|---|
| 6cb16fa | urwahnawaz | 2024-01-17 |
frax_results_lfc %>%
dplyr::filter(adj.P.Val < 0.05) %>%
mutate(condition="FRAX") %>%
inner_join(dsbs, by = "ensembl_gene_id") %>%
dplyr::select(gene = SYMBOL, Expression = res, everything()) %>%
DT::datatable(caption = "Genes in FRAX DEGs with DSBs")
upf1_results_lfc %>%
dplyr::filter(adj.P.Val < 0.05) %>%
mutate(condition="FRAX") %>%
inner_join(dsbs, by = "ensembl_gene_id") %>%
dplyr::select(gene = SYMBOL, Expression = res, everything()) %>%
DT::datatable(caption = "Genes in UPF1 DEGs with DSBs")
sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
locale:
[1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8
[5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8
[7] LC_PAPER=en_AU.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C
time zone: Australia/Adelaide
tzcode source: system (glibc)
attached base packages:
[1] grid stats4 tools stats graphics grDevices utils
[8] datasets methods base
other attached packages:
[1] GeneOverlap_1.38.0 ggstatsplot_0.12.1
[3] VennDiagram_1.7.3 futile.logger_1.4.3
[5] fgsea_1.28.0 msigdbr_7.5.1
[7] org.Hs.eg.db_3.18.0 ggrepel_0.9.4
[9] EnsDb.Hsapiens.v86_2.99.0 gridExtra_2.3
[11] naniar_1.0.0 glmpca_0.2.0
[13] broom_1.0.5 cowplot_1.1.1
[15] glue_1.6.2 ggfortify_0.4.16
[17] stargazer_5.2.3 ngsReports_2.4.0
[19] patchwork_1.1.3 AnnotationHub_3.10.0
[21] BiocFileCache_2.10.1 dbplyr_2.4.0
[23] openxlsx_4.2.5.2 ggiraph_0.8.8
[25] DT_0.31 msigdb_1.10.0
[27] GSEABase_1.64.0 graph_1.80.0
[29] annotate_1.80.0 XML_3.99-0.16
[31] pheatmap_1.0.12 ggvenn_0.1.10
[33] MetBrewer_0.2.0 ggpubr_0.6.0
[35] venn_1.11 viridis_0.6.4
[37] viridisLite_0.4.2 tximeta_1.20.1
[39] tximport_1.30.0 goseq_1.54.0
[41] geneLenDataBase_1.38.0 BiasedUrn_2.0.11
[43] org.Mm.eg.db_3.18.0 EnsDb.Mmusculus.v79_2.99.0
[45] ensembldb_2.26.0 AnnotationFilter_1.26.0
[47] GenomicFeatures_1.54.1 AnnotationDbi_1.64.1
[49] biomaRt_2.58.0 edgeR_4.0.3
[51] limma_3.58.1 DESeq2_1.42.0
[53] SummarizedExperiment_1.32.0 Biobase_2.62.0
[55] MatrixGenerics_1.14.0 matrixStats_1.2.0
[57] GenomicRanges_1.54.1 GenomeInfoDb_1.38.2
[59] IRanges_2.36.0 S4Vectors_0.40.2
[61] BiocGenerics_0.48.1 corrplot_0.92
[63] lubridate_1.9.3 forcats_1.0.0
[65] purrr_1.0.2 readr_2.1.4
[67] tidyverse_2.0.0 stringr_1.5.1
[69] tidyr_1.3.0 scales_1.3.0
[71] data.table_1.14.10 readxl_1.4.3
[73] tibble_3.2.1 magrittr_2.0.3
[75] reshape2_1.4.4 ggplot2_3.4.4
[77] dplyr_1.1.4 workflowr_1.7.1
loaded via a namespace (and not attached):
[1] fs_1.6.3 ProtGenerics_1.34.0
[3] bitops_1.0-7 insight_0.19.7
[5] httr_1.4.7 RColorBrewer_1.1-3
[7] backports_1.4.1 utf8_1.2.4
[9] R6_2.5.1 statsExpressions_1.5.2
[11] lazyeval_0.2.2 mgcv_1.9-0
[13] withr_2.5.2 prettyunits_1.2.0
[15] cli_3.6.2 formatR_1.14
[17] sandwich_3.1-0 labeling_0.4.3
[19] sass_0.4.8 mvtnorm_1.2-4
[21] pbapply_1.7-2 Rsamtools_2.18.0
[23] systemfonts_1.0.5 rstudioapi_0.15.0
[25] RSQLite_2.3.4 generics_0.1.3
[27] BiocIO_1.12.0 gtools_3.9.5
[29] crosstalk_1.2.1 vroom_1.6.5
[31] car_3.1-2 zip_2.3.0
[33] GO.db_3.18.0 Matrix_1.6-4
[35] fansi_1.0.6 abind_1.4-5
[37] lifecycle_1.0.4 multcomp_1.4-25
[39] whisker_0.4.1 yaml_2.3.8
[41] carData_3.0-5 gplots_3.1.3
[43] SparseArray_1.2.2 paletteer_1.5.0
[45] blob_1.2.4 promises_1.2.1
[47] crayon_1.5.2 lattice_0.22-5
[49] KEGGREST_1.42.0 zeallot_0.1.0
[51] pillar_1.9.0 knitr_1.45
[53] rjson_0.2.21 estimability_1.4.1
[55] admisc_0.34 codetools_0.2-19
[57] fastmatch_1.1-4 getPass_0.2-4
[59] vctrs_0.6.5 png_0.1-8
[61] cellranger_1.1.0 gtable_0.3.4
[63] rematch2_2.1.2 datawizard_0.9.0
[65] cachem_1.0.8 xfun_0.41
[67] S4Arrays_1.2.0 mime_0.12
[69] correlation_0.8.4 coda_0.19-4
[71] survival_3.5-7 statmod_1.5.0
[73] TH.data_1.1-2 interactiveDisplayBase_1.40.0
[75] ellipsis_0.3.2 nlme_3.1-164
[77] bit64_4.0.5 progress_1.2.3
[79] filelock_1.0.3 rprojroot_2.0.4
[81] bslib_0.6.1 KernSmooth_2.23-22
[83] colorspace_2.1-0 DBI_1.1.3
[85] tidyselect_1.2.0 processx_3.8.3
[87] emmeans_1.8.9 bit_4.0.5
[89] compiler_4.3.2 curl_5.2.0
[91] git2r_0.33.0 xml2_1.3.6
[93] ggdendro_0.1.23 DelayedArray_0.28.0
[95] plotly_4.10.3 bayestestR_0.13.1
[97] rtracklayer_1.62.0 caTools_1.18.2
[99] callr_3.7.3 rappdirs_0.3.3
[101] digest_0.6.33 rmarkdown_2.25
[103] XVector_0.42.0 htmltools_0.5.7
[105] pkgconfig_2.0.3 highr_0.10
[107] fastmap_1.1.1 rlang_1.1.2
[109] htmlwidgets_1.6.4 shiny_1.8.0
[111] farver_2.1.1 jquerylib_0.1.4
[113] zoo_1.8-12 jsonlite_1.8.8
[115] BiocParallel_1.36.0 RCurl_1.98-1.13
[117] GenomeInfoDbData_1.2.11 parameters_0.21.3
[119] munsell_0.5.0 Rcpp_1.0.11
[121] babelgene_22.9 visdat_0.6.0
[123] stringi_1.8.3 zlibbioc_1.48.0
[125] MASS_7.3-60 plyr_1.8.9
[127] parallel_4.3.2 Biostrings_2.70.1
[129] splines_4.3.2 pander_0.6.5
[131] hms_1.1.3 locfit_1.5-9.8
[133] ps_1.7.5 uuid_1.1-1
[135] ggsignif_0.6.4 effectsize_0.8.6
[137] futile.options_1.0.1 BiocVersion_3.18.1
[139] evaluate_0.23 lambda.r_1.2.4
[141] BiocManager_1.30.22 tzdb_0.4.0
[143] httpuv_1.6.13 MatrixModels_0.5-3
[145] BayesFactor_0.9.12-4.6 xtable_1.8-4
[147] restfulr_0.0.15 rstatix_0.7.2
[149] later_1.3.2 memoise_2.0.1
[151] GenomicAlignments_1.38.0 timechange_0.2.0
[153] here_1.0.1